/*
 Navicat Premium Data Transfer

 Source Server         : 本地
 Source Server Type    : MySQL
 Source Server Version : 50723
 Source Host           : localhost:3306
 Source Schema         : private_im

 Target Server Type    : MySQL
 Target Server Version : 50723
 File Encoding         : 65001

 Date: 06/12/2021 01:32:33
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for group_msg
-- ----------------------------
DROP TABLE IF EXISTS `group_msg`;
CREATE TABLE `group_msg` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `from_id` int(10) NOT NULL DEFAULT '0' COMMENT '发起人',
  `group_id` int(10) NOT NULL DEFAULT '0' COMMENT '群id',
  `msg` varchar(255) NOT NULL DEFAULT '' COMMENT '消息类型',
  `from_type` tinyint(2) NOT NULL DEFAULT '1' COMMENT '发起人类型1 用户 2 客服',
  `type` tinyint(2) NOT NULL DEFAULT '0' COMMENT '消息类型',
  `add_time` int(10) NOT NULL DEFAULT '0' COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of group_msg
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for private_msg
-- ----------------------------
DROP TABLE IF EXISTS `private_msg`;
CREATE TABLE `private_msg` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT 'msg_id',
  `from_id` int(10) NOT NULL DEFAULT '0' COMMENT '发起人',
  `to_id` int(10) NOT NULL DEFAULT '0' COMMENT '接受人',
  `type` tinyint(2) NOT NULL DEFAULT '1' COMMENT '消息状态，1 消息 2图片 3 视频 5语音',
  `content` varchar(255) NOT NULL DEFAULT '' COMMENT '内容',
  `add_time` int(10) NOT NULL DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of private_msg
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for room
-- ----------------------------
DROP TABLE IF EXISTS `room`;
CREATE TABLE `room` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `user_id` int(10) NOT NULL DEFAULT '0',
  `service_id` int(10) NOT NULL DEFAULT '0',
  `add_time` int(10) NOT NULL DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of room
-- ----------------------------
BEGIN;
INSERT INTO `room` VALUES (1, 1, 1, 0);
COMMIT;

-- ----------------------------
-- Table structure for service_user
-- ----------------------------
DROP TABLE IF EXISTS `service_user`;
CREATE TABLE `service_user` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT '' COMMENT '客服名称',
  `token` varchar(255) NOT NULL DEFAULT '' COMMENT '客服token',
  `status` tinyint(2) NOT NULL DEFAULT '0' COMMENT '是否在线 0 否 1是',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of service_user
-- ----------------------------
BEGIN;
INSERT INTO `service_user` VALUES (1, '客服01', '061102a8-0708-42ce-9165-fc4d9ec6d1a0', 1);
COMMIT;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'user_id',
  `username` varchar(255) NOT NULL DEFAULT '' COMMENT '用户名',
  `token` varchar(255) NOT NULL DEFAULT '' COMMENT 'token',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
INSERT INTO `user` VALUES (1, '小明', 'ceb04dd3-3869-416f-a647-3e1f5b452b5f');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
